#!/usr/bin/env bash
# 应该先探索数据的比如看看数据的平衡性
# 万一有就惨了 there the pixel that have multi label?
#首先添加slim路径，每次打开terminal都要加载路径
cd models/research/
    export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim

#Quick test by running model_test.py:
# From tensorflow/models/research/
python deeplab/model_test.py

python build_voc2012_data.py \
  --image_folder="f:\Resources\kdata\severstal-steel-defect-detection\train_images" \
  --semantic_segmentation_folder="f:\Resources\kdata\severstal-steel-defect-detection\mask" \
  --list_folder="f:\Resources\kdata\severstal-steel-defect-detection\index\train.txt" \
  --image_format="jpg" \
  --output_dir="f:\Resources\kdata\severstal-steel-defect-detection\tfrecord"

python train.py \
  --logtostderr \
  --train_split="train" \
  --model_variant="xception_65" \
  --atrous_rates=6 \
  --atrous_rates=12 \
  --atrous_rates=18 \
  --output_stride=16 \
  --decoder_output_stride=4 \
  --train_crop_size=256 \
  --train_crop_size=1600 \
  --train_batch_size=2 \
  --training_number_of_steps=3 \
  --fine_tune_batch_norm=True \
  --tf_initial_checkpoint="/data/soft/redldw/severstal-steel-defect-detection/model/deeplabv3_cityscapes_train/model.ckpt" \
  --train_logdir="/data/soft/redldw/severstal-steel-defect-detection/logdir/train" \
  --dataset_dir="/data/soft/redldw/severstal-steel-defect-detection/tfrecord"

python eval.py \
  --logtostderr \
  --eval_split="trainval" \
  --model_variant="xception_65" \
  --atrous_rates=6 \
  --atrous_rates=12 \
  --atrous_rates=18 \
  --output_stride=16 \
  --decoder_output_stride=4 \
  --eval_crop_size=256 \
  --eval_crop_size=1600 \
  --checkpoint_dir="/data/soft/redldw/severstal-steel-defect-detection/logdir/train" \
  --eval_logdir="/data/soft/redldw/severstal-steel-defect-detection/logdir/eval" \
  --dataset_dir="/data/soft/redldw/severstal-steel-defect-detection/tfrecord"

python vis.py \
  --logtostderr \
  --vis_split="val" \
  --model_variant="xception_65" \
  --atrous_rates=6 \
  --atrous_rates=12 \
  --atrous_rates=18 \
  --output_stride=16 \
  --decoder_output_stride=4 \
  --vis_crop_size=256 \
  --vis_crop_size=1600 \
  --checkpoint_dir="/data/soft/redldw/severstal-steel-defect-detection/logdir/train" \
  --vis_logdir="/data/soft/redldw/severstal-steel-defect-detection/logdir/vis" \
  --dataset_dir="/data/soft/redldw/severstal-steel-defect-detection/tfrecord"